package org.javaforever.cookieshop.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import jakarta.servlet.http.HttpSession;

@Controller
public class AdminCustController { 
    
    @GetMapping({"/admin/index","/admin/","/admin"})
    public String adminIndex(HttpSession session, Model model) throws Exception{
    	if (session.getAttribute("user") == null) {
    		return "redirect:../login/index.html";
    	}
        return "admin/index";
    }
 }
